import request from '#/utils/requestAbort';

// 获取文件
export function fetchFile(fileId) {
  return request(`/annex/annex/downLoadFile/${fileId}`, {
    method: 'GET',
  });
}

// 上传文件
export async function upLoadFile(file, fileName) {
  const data = new window.FormData();
  data.append('file', file);
  data.append('fileName', fileName);
  return request(`/annex/annex/upLoadFiles`, {
    method: 'POST',
    requestType: 'form',
    data,
  });
}

// 删除文件
export async function deleteFile(fileId) {
  return request(`/annex/annex/delete/${fileId}`, {
    method: 'GET',
  });
}
